package server;

/**
 *
 * @author Michael Hanns
 *
 */
public class NetworkPreferencesImp implements NetworkPreferences {

    private String playerFilePath;
    private String motd;

    public NetworkPreferencesImp() {
        playerFilePath = "players/";
        motd = "";
    }

    @Override
    public String getPlayerFilePath() {
        return playerFilePath;
    }

    @Override
    public String getMOTD() {
        if (motd.length() > 0) {
            String returnMOTD = "\nMessage of the Day:\n"
                    + "-------------------\n"
                    + motd
                    + "\n-------------------\n";
            return returnMOTD;
        }
        return motd;
    }

    @Override
    public void setPlayerFilePath(String path) {
        if(!!path.endsWith("\\") && !path.endsWith("/"))
            path = path + "\\";
        playerFilePath = path;
    }

    @Override
    public void setMOTD(String message) {
        motd = message;
    }
}
